package com.jdk.demo.nio.charbuffer;

import java.nio.CharBuffer;

public class CharBufferCharAt {
	
	// charAt：读取相对于当前位置的给定索引处的字符
	public static void main(String[] args) {
		CharBuffer charbuffer = CharBuffer.allocate(10);
		charbuffer.append("abcdefg");
		charbuffer.position(2);
		System.out.println(charbuffer.charAt(0));
		System.out.println(charbuffer.charAt(1));
		System.out.println(charbuffer.charAt(2));
	}

}
